$(function () {
    $('#AttendTable').bootstrapTable({
        url: '/AttendenceManager/selectUserAttend',
        method: 'get',
        showRefresh: true,  //显示刷新按钮
        toolbar: '#toolbar',
        striped: true,     //设置为true会有隔行变色效果
        //sidePagination:'server',//服务器端分页默认接受rows和total
        pagination: true,//客户端分页
        sidePagination: 'client',
        idFiled: 'studentSelectCourseId',
        pageNumber: 1,
        pageSize: 10,
        columns: [
            {
                field: 'name',
                title: '姓名'
            }
            , {
                field: 'positionName',
                title: '岗位'
            }, {
                field: 'attend_in_time',
                title: '签到时间',
                formatter: function (attend_in_time) {
                    var tmpDate = new Date(attend_in_time);
                    var yy = tmpDate.getFullYear();

                    var m = tmpDate.getMonth() + 1;

                    var dd = tmpDate.getDate();

                    var hh = tmpDate.getHours();

                    var mm = tmpDate.getMinutes();

                    var ss = tmpDate.getSeconds();

                    return yy + '-' + m + '-' + dd + ' ' + hh + ':' + mm + ':' + ss;

                }
            }, {
                field: 'attend_out_time',
                title: '签退时间',
                formatter: function (attend_out_time) {
                    var tmpDate = new Date(attend_out_time);
                    var yy = tmpDate.getFullYear();

                    var m = tmpDate.getMonth() + 1;

                    var dd = tmpDate.getDate();

                    var hh = tmpDate.getHours();

                    var mm = tmpDate.getMinutes();

                    var ss = tmpDate.getSeconds();

                    return yy + '-' + m + '-' + dd + ' ' + hh + ':' + mm + ':' + ss;

                }

            }
        ]
    });
});